package org.Lin.launcher;

import javax.swing.*;
import java.awt.*;

public class ClientLauncher {

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            JFrame frame = new JFrame("在线聊天中心 - 客户端");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(400, 300);
            frame.setLayout(new GridLayout(3, 1));

            JButton loginButton = new JButton("登录");
            JButton registerButton = new JButton("注册");
            JButton exitButton = new JButton("退出");

            loginButton.addActionListener(e -> {
                new org.Lin.client.LoginClient().show();
                frame.dispose();
            });

            registerButton.addActionListener(e -> {
                new org.Lin.client.RegisterClient().show();
                frame.dispose();
            });

            exitButton.addActionListener(e -> System.exit(0));

            frame.add(loginButton);
            frame.add(registerButton);
            frame.add(exitButton);
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        });
    }
}
